

function ai (){
    task = {
        "supplier":{
            "repare":{},
            "build":{}
        },
        "miner":{
            "takePlace":{}
        },
        "engineer":{
            "takePlace": {}
        },
        "harvester":{
            "takePlace":{}
        },
        "cooker":{
            "takePlace":{}
        },
        "defender":{
            "takePlace":{}
        },
        "scientist":{
            "takePlace":{}
        },
        "soldier":{
            "takePlace":{}
        }
    };

    noids = {
        "idle":{},
        "supplier":{},
        "miner":{},
        "engineer":{},
        "harvester":{},
        "cooker":{},
        "defender":{},
        "scientist":{},
        "soldier":{}
    }
}

ai.prototype.addTask = function(type, action, entity){
    (this.task[type] == undefined) ? this.task[type] = {} : false ;
    (this.task[type][action] == undefined) ? this.task[type][action] = {} : false ;
    var time = new Date();
    this.task[type][action][time.time()] = entity;
    return time.time();
}
ai.prototype.delTask = function(type, action, time){
    delete(this.task[type][action][time]);
}
ai.prototype.searchTask = function(type){
    for(var key in this.task[type]){
        if(this.task[type][key].length){

        }
    }
}
